package com.grgbanking.voice.util;

import android.app.Activity;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by hesheng on 2017/6/1.
 */

public final class ActivityUtils {

    private static final List<Activity> activitys = new ArrayList<Activity>();

    public static void add(Activity activity) {
        activitys.add(activity);
    }

    public static void remove(Activity activity) {
        activitys.remove(activity);
    }

    public static void finishAll() {
        for (Activity activity: activitys) {
            if (!activity.isFinishing()) {
                activity.finish();
            }
        }
    }
}
